package cn.itcast.user.client;

import cn.itcast.order.model.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @program: springclould-demo
 * @description:
 * @author: sch
 * @create: 2023-04-02 02:21
 **/
@FeignClient(name = "itcast-order-nacos", path = "/order")
public interface OrderServiceClient {

    @RequestMapping("orderList")
    List<OrderInfo> orderList();


    /**
     * @RequestMapping("orderList")
     * public List<OrderInfo> orderList() {
     * System.out.println("order  =========> orderList...");
     * List<OrderInfo> orderInfos = orderService.listOrder();
     * if (CollUtil.isEmpty(orderInfos)) {
     * System.out.println("未查到数据....");
     * }
     * <p>
     * //        for (OrderInfo orderInfo : orderInfos) {
     * //            System.out.println(orderInfo.getId() + ":" + orderInfo.getOrderNo());
     * //        }
     * <p>
     * return orderInfos;
     * }
     */

    @RequestMapping("findOrderByUserId")
    List<OrderInfo> findOrderByUserId(@RequestParam("userId") Long userId);
    /*

     @RequestMapping("findOrderByUserId")
     public List<OrderInfo> findOrderByUserId(Long userId) {
     List<OrderInfo> orderInfos = orderService.findOrderByUserId(userId);
     if (CollUtil.isEmpty(orderInfos)) {
     System.out.println("未查到数据....");
     }

     System.out.println("order.findOrderByUserId查询成功" + orderInfos);
     return orderInfos;
     }
     */
}
